{% extends 'preheat/base.html' %}

{% block title %}编辑用户 - CDN预热平台{% endblock %}

{% block page_title %}编辑用户{% endblock %}

{% block content %}
    <div class="card">
        <div class="card-body">
            <form method="post">
                {% csrf_token %}
                
                <div class="form-group">
                    <label for="id_username">用户名 <span class="text-danger">*</span></label>
                    {{ form.username }}
                    {% if form.username.errors %}
                        <div class="text-danger">
                            {% for error in form.username.errors %}
                                {{ error }}
                            {% endfor %}
                        </div>
                    {% endif %}
                </div>
                
                <div class="form-group">
                    <label for="id_email">邮箱</label>
                    {{ form.email }}
                    {% if form.email.errors %}
                        <div class="text-danger">
                            {% for error in form.email.errors %}
                                {{ error }}
                            {% endfor %}
                        </div>
                    {% endif %}
                </div>
                
                <div class="form-group">
                    <label for="id_phone">手机号</label>
                    {{ form.phone }}
                    {% if form.phone.errors %}
                        <div class="text-danger">
                            {% for error in form.phone.errors %}
                                {{ error }}
                            {% endfor %}
                        </div>
                    {% endif %}
                </div>
                
                <div class="form-actions">
                    <button type="submit" class="btn btn-primary">保存</button>
                    <a href="{% url 'preheat:user_list' %}" class="btn btn-secondary">取消</a>
                </div>
            </form>
        </div>
    </div>
{% endblock %}